package role_manager

import "zinx_game/service"

type RoleManager struct {
	roles map[string]*service.Role
}

func NewRoleManager() *RoleManager {
	return &RoleManager{
		roles: make(map[string]*service.Role),
	}
}

func (rm *RoleManager) AddRole(r *service.Role) {
	rm.roles[r.ID] = r
}

func (rm *RoleManager) RemoveRole(id string) {
	delete(rm.roles, id)
}

func (rm *RoleManager) GetRole(id string) *service.Role {
	return rm.roles[id]
}
